<template>
  <div class="background-container">
    <div class="container">
      <!-- 第一列，上下两块 -->
      <div class="column" style="width: 50%;">
        <div class="block" style="height: 50%;">
          <div class="block-content">
            <ItemWrap title="异构资源表征及预测模块">
              <Topology />
            </ItemWrap>
          </div>
        </div>
        <div class="block" style="height: 50%;">
          <div class="block-content">
            <ItemWrap title="实时业务流量感知模块">
              <Graph />
            </ItemWrap>
          </div>
        </div>
      </div>

      <!-- 第二列，三块 -->
      <div class="column" style="width: 50%;">
        <div class="block" style="height: 50%;">
          <div class="block-content">
            <ItemWrap title="业务界面呈现模块">
              <Live />
            </ItemWrap>
          </div>
        </div>
        <div class="block" style="height: 50%;">
          <div class="block-content">
            <ItemWrap title="智能化网络负载分析模块">
              <Switch />
            </ItemWrap>
          </div>
        </div>
      </div>
    </div>
    <router-view />
  </div>
</template>

<script>
import Topology from "@/components/echarts/topology/Topology.vue"
import Graph from "@/components/echarts/system/Graph.vue";
import Live from "@/components/live/live.vue";
import Switch from "@/components/echarts/topology/Switch.vue"

export default {
  name: 'LiveStreaming',
  components: {
    Graph,
    Live,
    Switch,
    Topology
  },
  data() {
    return {
    };
  },
  methods: {
  }
};
</script>

<style lang="scss" scoped>
.container {
  height: 100%;
  display: flex;
  position: relative;
  z-index: 1;
}

.background-container {
  position: relative;
  width: 100%;
  height: 94%;
  overflow: hidden;
}

.column {
  display: flex;
  flex-direction: column;
}

.block-content {
  font-size: 26px;
  height: 95%;
  width: 95%;
  border-radius: 10px;
  display: flex;
  margin: auto;
  position: relative; // 添加相对定位
}

// 新增切换按钮样式
.switch-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;

  &:hover {
    background: rgba(255, 255, 255, 0.3);
  }
}

.switch-icon {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  position: relative;

  &::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    top: 2px;
    left: 2px;
    transform: rotate(45deg);
  }
}

.video {
  object-fit: fill;
  width: 100%;
  height: 100%;
}

@keyframes rotating {
  0% {
    -webkit-transform: rotate(0) scale(1);
    transform: rotate(0) scale(1);
  }

  50% {
    -webkit-transform: rotate(180deg) scale(1.1);
    transform: rotate(180deg) scale(1.1);
  }

  100% {
    -webkit-transform: rotate(360deg) scale(1);
    transform: rotate(360deg) scale(1);
  }
}
</style>